Package com.google.speedtracer.client.util

Examples of com.google.speedtracer.client.util.Url


  }

  private SymbolServerController getCurrentSymbolServerController() {
    SluggishnessModel sModel = (SluggishnessModel) getVisualization().getModel();
    String resourceUrl = sModel.getDataDispatcher().getTabDescription().getUrl();
    return SymbolServerService.getSymbolServerController(new Url(resourceUrl));
  }
View Full Code Here


  }

  private void maybeInitializeSymbolServerController(
      TabDescription tabDescription) {
    LocalStorage storage = WindowExt.getHostWindow().getLocalStorage();
    Url resourceUrl = new Url(tabDescription.getUrl());

    // We are not permitted to do file:// XHRs.
    if (Url.SCHEME_FILE.equals(resourceUrl.getScheme())) {
      return;
    }

    String symbolManifestUrl = storage.getStringItem(resourceUrl.getApplicationUrl());

    if (symbolManifestUrl == null || symbolManifestUrl.equals("")) {
      // Attempt to fetch one at a predetermined location.
      symbolManifestUrl = resourceUrl.getResourceBase() + "symbolmanifest.json";
    }

    SymbolServerService.registerSymbolServerController(resourceUrl, new Url(
        symbolManifestUrl));
  }
View Full Code Here

  @Override
  protected void populateContent(Element contentElement) {
    // No-need to build the UI. UI binder does it all.
    // Only need to populate default values.
    final Url resourceUrl = new Url(tabDescription.getUrl());
    final String applicationUrl = resourceUrl.getApplicationUrl();
    appUrl.setValue(applicationUrl);
    final LocalStorage storage = WindowExt.getHostWindow().getLocalStorage();
    String previousManifestValue = storage.getStringItem(applicationUrl);
    symbolManifestUrl.setValue(previousManifestValue);

    // And wire up the save button.
    ClickEvent.addClickListener(saveButton, saveButton, new ClickListener() {
      public void onClick(ClickEvent event) {
        if (null == symbolManifestUrl.getValue()) {
          return;
        }
        storage.setStringItem(applicationUrl, symbolManifestUrl.getValue());

        // Register the SSController.
        SymbolServerService.registerSymbolServerController(resourceUrl,
            new Url(symbolManifestUrl.getValue()));

        SymbolServerEntryPanel.this.hide();
      }
    });
  }
View Full Code Here

    String sourceFileName = fileName.substring(fileName.lastIndexOf('/') + 1,
        fileName.length());

    String sourceSymbolName = className + "::" + memberName;

    JsSymbol sourceSymbol = new JsSymbol(new Url(sourcePathBase
        + sourceFileName), Integer.parseInt(sourceLine), sourceSymbolName,
        false, fileName);
    symbolMap.put(jsName, sourceSymbol);
  }
View Full Code Here

   * Page transitions can also be marked so that if we navigate back to a
   * previous application state, we can see the point at which we tried to
   * navigate away.
   */
  public void onPageTransition(TabChangeEvent change) {
    Url refresh = new Url(change.getUrl());
    String resource = refresh.getLastPathComponent();
    String description = "Navigating to "
        + (resource.equals("") ? refresh.getUrl() : resource);
    timelineMarks.addMark(change.getTime(), Color.BLUE, description,
        description, true);
    timelineMarks.drawMarksInBounds(mainTimeLineModel.getLeftBound(),
        mainTimeLineModel.getRightBound());
  }
View Full Code Here

  /**
   * Mark line on timeline when we refresh a page.
   */
  public void onRefresh(TabChangeEvent change) {
    Url refresh = new Url(change.getUrl());
    String resource = refresh.getLastPathComponent();
    String description = "Refresh of "
        + (resource.equals("") ? refresh.getUrl() : resource);
    timelineMarks.addMark(change.getTime(), Color.LIGHT_BLUE, description,
        description, false);
    timelineMarks.drawMarksInBounds(mainTimeLineModel.getLeftBound(),
        mainTimeLineModel.getRightBound());
  }
View Full Code Here

    // The path relative to the source server. We assume it is just the class
    // path base.
    String sourcePathBase = packageName.replace(".", "/");
    String sourceSymbolName = packageName + className + "::" + memberName;

    JsSymbol sourceSymbol = new JsSymbol(new Url(sourcePathBase + fileName),
        Integer.parseInt(sourceLine), sourceSymbolName, false, fileName);
    symbolMap.put(jsName, sourceSymbol);
  }
View Full Code Here

    String currentAppUrl = eventWaterfall.getVisualization().getModel().getDataDispatcher().getTabDescription().getUrl();
    jsProfileRenderer = new JavaScriptProfileRenderer(
        container,
        resources,
        this,
        SymbolServerService.getSymbolServerController(new Url(currentAppUrl)),
        this,
        eventWaterfall.getVisualization().getModel().getJavaScriptProfileForEvent(
            getParentRow().getEvent()), new SourceSymbolClickListener() {
          public void onSymbolClicked(String resourceUrl,
              SourceViewerServer sourceViewerServer, int lineNumber,
View Full Code Here

      switch (symbolType.getValue()) {
        case JavaScriptProfileModelV8Impl.SYMBOL_TYPE_CALLBACK:
          symbol = new JsSymbol(JavaScriptProfile.NO_RESOURCE, 0, rawName, true);
          break;
        case JavaScriptProfileModelV8Impl.SYMBOL_TYPE_SCRIPT:
          symbol = new JsSymbol(new Url(rawName), 0, "[ScriptCompilation]");
          break;
        default:
          // We assume that the rest is a symbol in the page.
          JSOArray<String> pieces = JSOArray.splitString(rawName, " ");

          if (pieces.size() < 2) {
            symbol = new JsSymbol(JavaScriptProfile.NO_RESOURCE, 0, rawName);
            break;
          }

          String urlAndLine = pieces.get(1);
          String symbolName = pieces.get(0);
          boolean isNative = false;

          if (urlAndLine.equals("native")) {
            urlAndLine = pieces.get(2);
            isNative = true;
          }

          int lineNumberIndex = urlAndLine.lastIndexOf(':');
          if (lineNumberIndex > 0) {
            Url resourceUrl = new Url(urlAndLine.substring(0, lineNumberIndex));
            // The assumption is that this will always have a line number.
            // Should test to verify.
            int lineNumber = Integer.parseInt(urlAndLine.substring(lineNumberIndex + 1));
            symbol = new JsSymbol(resourceUrl, lineNumber, symbolName, isNative);
          } else {
            symbol = new JsSymbol(new Url(urlAndLine), 0, symbolName, isNative);
          }
          break;
      }
      return symbol;
    }
View Full Code Here

    resultsDiv.setInnerText("");
  }

  private SymbolServerController getSymbolServerController() {
    String url = dataDispatcher.getTabDescription().getUrl();
    return SymbolServerService.getSymbolServerController(new Url(url));
  }
View Full Code Here

TOP

Related Classes of com.google.speedtracer.client.util.Url

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.