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

Side by Side Diff: content/browser/debugger/devtools_netlog_observer.cc

Issue 10494012: Move mock notification observer header from content\test to content\public\test. This way we can en… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/thread_observer_helper.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/debugger/devtools_netlog_observer.h" 5 #include "content/browser/debugger/devtools_netlog_observer.h"
6 6
7 #include "base/string_tokenizer.h" 7 #include "base/string_tokenizer.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void DevToolsNetLogObserver::OnAddEntry(net::NetLog::EventType type, 41 void DevToolsNetLogObserver::OnAddEntry(net::NetLog::EventType type,
42 const base::TimeTicks& time, 42 const base::TimeTicks& time,
43 const net::NetLog::Source& source, 43 const net::NetLog::Source& source,
44 net::NetLog::EventPhase phase, 44 net::NetLog::EventPhase phase,
45 net::NetLog::EventParameters* params) { 45 net::NetLog::EventParameters* params) {
46 // The events that the Observer is interested in only occur on the IO thread. 46 // The events that the Observer is interested in only occur on the IO thread.
47 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) 47 if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
48 return; 48 return;
49
50 // The events that the Observer is interested in only occur on the IO thread.
51 if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
52 return;
53 if (source.type == net::NetLog::SOURCE_URL_REQUEST) 49 if (source.type == net::NetLog::SOURCE_URL_REQUEST)
54 OnAddURLRequestEntry(type, time, source, phase, params); 50 OnAddURLRequestEntry(type, time, source, phase, params);
55 else if (source.type == net::NetLog::SOURCE_HTTP_STREAM_JOB) 51 else if (source.type == net::NetLog::SOURCE_HTTP_STREAM_JOB)
56 OnAddHTTPStreamJobEntry(type, time, source, phase, params); 52 OnAddHTTPStreamJobEntry(type, time, source, phase, params);
57 else if (source.type == net::NetLog::SOURCE_SOCKET) 53 else if (source.type == net::NetLog::SOURCE_SOCKET)
58 OnAddSocketEntry(type, time, source, phase, params); 54 OnAddSocketEntry(type, time, source, phase, params);
59 } 55 }
60 56
61 void DevToolsNetLogObserver::OnAddURLRequestEntry( 57 void DevToolsNetLogObserver::OnAddURLRequestEntry(
62 net::NetLog::EventType type, 58 net::NetLog::EventType type,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 287
292 RequestToEncodedDataLengthMap::iterator it = 288 RequestToEncodedDataLengthMap::iterator it =
293 dev_tools_net_log_observer->request_to_encoded_data_length_.find( 289 dev_tools_net_log_observer->request_to_encoded_data_length_.find(
294 source_id); 290 source_id);
295 if (it == dev_tools_net_log_observer->request_to_encoded_data_length_.end()) 291 if (it == dev_tools_net_log_observer->request_to_encoded_data_length_.end())
296 return -1; 292 return -1;
297 int encoded_data_length = it->second; 293 int encoded_data_length = it->second;
298 it->second = 0; 294 it->second = 0;
299 return encoded_data_length; 295 return encoded_data_length;
300 } 296 }
OLDNEW
« no previous file with comments | « chrome/test/base/thread_observer_helper.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698