Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 11635023: First cut at UI for saving net_logs data into a temporary file on (Closed)

Created:
8 years ago by ramant (doing other things)
Modified:
7 years, 11 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, arv (Not doing code reviews), darin-cc_chromium.org, mmenke, eroman, droger, Yaron
Visibility:
Public.

Description

First cut at UI for saving net_logs data into a temporary file on Mobile (Android and iOS). Added a new page chrome://net-export to start/stop/send the net_log for mobile platforms. Button "Start Saving (after deleting old data)" will start saving to a temporary file in "NetLog" directory in Temp directory. It deletes all the old temporary files that were in that directory before creating a new temporty file. It is a no-op if we are already saving data into a file. Button "Stop Saving Data" closes the temporary file so that it could be mailed. It is a no-op if we haven't started saving data into a file. Button "Send Data" emails the data file if a temporary file exists in "NetLog" directory. It is a no-op if there is no file. There is only a single temporary file into which we log the data. NetLog data is saved in the browser process. Logging of net_log data behaves similar to the command line option --log-net-log. If chrome://net-export is accessed in multiple tabs, action in first tab wins. If Stop is clicked in any tab, logging stops. If start is clicked in any tab, net logging starts. mmenke@ and/or eroman@ for chrome\browser\resources and webui changes. jar@ for net_log_temp_file changes. jhawkins@chromium.org for chrome\browser\ui\webui and chrome\browser\resources OWNERS stamp. R=jar@chromium.org, mmenke@chromium.org BUG=151212

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 9

Patch Set 8 : #

Patch Set 9 : #

Total comments: 6

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Patch Set 14 : #

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Patch Set 20 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+756 lines, -1 line) Patch
build/ios/grit_whitelist.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
chrome/browser/browser_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
chrome/browser/net/chrome_net_log.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +6 lines, -0 lines 0 comments Download
chrome/browser/net/chrome_net_log.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -1 line 0 comments Download
chrome/browser/net/net_log_logger.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -0 lines 0 comments Download
chrome/browser/net/net_log_logger.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +4 lines, -0 lines 0 comments Download
chrome/browser/net/net_log_temp_file.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +96 lines, -0 lines 0 comments Download
chrome/browser/net/net_log_temp_file.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +208 lines, -0 lines 0 comments Download
chrome/browser/resources/net_export/net_export.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +61 lines, -0 lines 0 comments Download
chrome/browser/resources/net_export/net_export.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +175 lines, -0 lines 0 comments Download
chrome/browser/resources/web_dev_style/js_checker.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -0 lines 0 comments Download
chrome/browser/ui/webui/net_export_ui.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -0 lines 0 comments Download
chrome/browser/ui/webui/net_export_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +166 lines, -0 lines 0 comments Download
chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
chrome/common/url_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
chrome/common/url_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
ramant (doing other things)
droger@, qsr@ and yfriedman@ would appreciate if you could take a look at android/iOS related ...
8 years ago (2012-12-20 22:52:32 UTC) #1
mmenke
[+eroman] I have not yet fully reviewed this. I intend to take a closer look ...
7 years, 11 months ago (2012-12-27 20:43:04 UTC) #2
ramant (doing other things)
Hi Matt, As you have suggested, added mobile.html to display the Mobile tab to start/stop/send ...
7 years, 11 months ago (2013-01-04 01:47:28 UTC) #3
mmenke
7 years, 11 months ago (2013-01-04 16:22:09 UTC) #4
I'm sorry, for some reason, I was thinking we were sharing log filtering code
with net-internals.

Since we're not doing this, do we even gain anything from integrating this with
net-internals?  Seems like we don't share any of the behaviors, other than
having communication with the browser.  This being the case, I'm thinking it
makes more sense to make a separate WebUI page.  It can even all run on the UI
thread - NetLog observers and the ChromeNetLog can safely be mucked with on the
UI thread.

I'm sorry again for sending you in this direction - if we needed to share any
code with net-internals, I think this approach (With some work on clearly
differentiating the mobile / non-mobile / shared JS code) would be the right
approach, but since we aren't using anything from net-internals...

https://codereview.chromium.org/11635023/diff/2006/chrome/browser/net/net_log...
File chrome/browser/net/net_log_temp_file.h (right):

https://codereview.chromium.org/11635023/diff/2006/chrome/browser/net/net_log...
chrome/browser/net/net_log_temp_file.h:49: static NetLogTempFile* GetInstance();
On 2013/01/04 01:47:28, ramant wrote:
> On 2012/12/27 20:43:05, Matt Menke wrote:
> > What's the motivation for making this a Singleton?
> 
> Made it a single to work with chrome://net-internals being opened in multiple
> tabs.

How much do we care about that use case?  I've been instilled with a dislike of
singletons unless absolutely necessary, and I'm not convinced it's absolutely
necessary here.

If we're really concerned about it, there's only one ChromeNetLog, and we could
expose these functions there instead, or have it own the NetLogTempFile, and
expose it directly.

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/net/net_lo...
File chrome/browser/net/net_log_logger.h (right):

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/net/net_lo...
chrome/browser/net/net_log_logger.h:46: net::NetLog* net_log_;
This isn't needed.  NetLog::ThreadSafeObserver has a net_log() function that
returns the same thing.

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/net/net_lo...
File chrome/browser/net/net_log_temp_file.h (right):

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/net/net_lo...
chrome/browser/net/net_log_temp_file.h:53: NetLogTempFile();
This shouldn't be public for a singleton.

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
File chrome/browser/resources/net_internals/mobile.html (right):

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
chrome/browser/resources/net_internals/mobile.html:15: <link rel="stylesheet"
href="tab_switcher_view.css">
To reduce redistributable size, we should be putting these in something like
chrome://net-internals/shared.css.  Same with shared JS and HTML files.  Think
this is simple enough that it can be done in this CL, though if you prefer to do
it in a followup CL, that's fine.

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
chrome/browser/resources/net_internals/mobile.html:18: <script
src="chrome://net-internals/mobile.js"></script>
Looks like you updated net_internals_resources.grd, but forgot to include it in
this CL.

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
File chrome/browser/resources/net_internals/mobile_main.js (right):

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
chrome/browser/resources/net_internals/mobile_main.js:77: false, true);
You're planning on getting rid of these in a later pass (Possibly in another
CL), right?

https://codereview.chromium.org/11635023/diff/28001/chrome/browser/resources/...
chrome/browser/resources/net_internals/mobile_main.js:187: function
ConstantsObserver() {}
Think it's worth moving the constants stuff to a shared js file, though fine to
do it in a followup CL.

Powered by Google App Engine
This is Rietveld 408576698