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

Side by Side Diff: content/browser/tracing/tracing_ui.cc

Issue 16256018: Update content/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrectly modified code Created 7 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
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/tracing/tracing_ui.h" 5 #include "content/browser/tracing/tracing_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 }; 117 };
118 118
119 // A proxy passed to the Read and Write tasks used when loading or saving trace 119 // A proxy passed to the Read and Write tasks used when loading or saving trace
120 // data. 120 // data.
121 class TaskProxy : public base::RefCountedThreadSafe<TaskProxy> { 121 class TaskProxy : public base::RefCountedThreadSafe<TaskProxy> {
122 public: 122 public:
123 explicit TaskProxy(const base::WeakPtr<TracingMessageHandler>& handler) 123 explicit TaskProxy(const base::WeakPtr<TracingMessageHandler>& handler)
124 : handler_(handler) {} 124 : handler_(handler) {}
125 void LoadTraceFileCompleteProxy(string16* file_contents, 125 void LoadTraceFileCompleteProxy(string16* file_contents,
126 const base::FilePath& path) { 126 const base::FilePath& path) {
127 if (handler_) 127 if (handler_.get())
128 handler_->LoadTraceFileComplete(file_contents, path); 128 handler_->LoadTraceFileComplete(file_contents, path);
129 delete file_contents; 129 delete file_contents;
130 } 130 }
131 131
132 void SaveTraceFileCompleteProxy() { 132 void SaveTraceFileCompleteProxy() {
133 if (handler_) 133 if (handler_.get())
134 handler_->SaveTraceFileComplete(); 134 handler_->SaveTraceFileComplete();
135 } 135 }
136 136
137 private: 137 private:
138 friend class base::RefCountedThreadSafe<TaskProxy>; 138 friend class base::RefCountedThreadSafe<TaskProxy>;
139 ~TaskProxy() {} 139 ~TaskProxy() {}
140 140
141 // The message handler to call callbacks on. 141 // The message handler to call callbacks on.
142 base::WeakPtr<TracingMessageHandler> handler_; 142 base::WeakPtr<TracingMessageHandler> handler_;
143 143
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { 552 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) {
553 web_ui->AddMessageHandler(new TracingMessageHandler()); 553 web_ui->AddMessageHandler(new TracingMessageHandler());
554 554
555 // Set up the chrome://tracing/ source. 555 // Set up the chrome://tracing/ source.
556 BrowserContext* browser_context = 556 BrowserContext* browser_context =
557 web_ui->GetWebContents()->GetBrowserContext(); 557 web_ui->GetWebContents()->GetBrowserContext();
558 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); 558 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource());
559 } 559 }
560 560
561 } // namespace content 561 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/ssl/ssl_manager.cc ('k') | content/browser/web_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698