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

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 DCHECK(instance_); 148 DCHECK(instance_);
149 DCHECK(delegate_); 149 DCHECK(delegate_);
150 } 150 }
151 151
152 RenderViewHost::~RenderViewHost() { 152 RenderViewHost::~RenderViewHost() {
153 delegate()->RenderViewDeleted(this); 153 delegate()->RenderViewDeleted(this);
154 154
155 // Be sure to clean up any leftover state from cross-site requests. 155 // Be sure to clean up any leftover state from cross-site requests.
156 Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest( 156 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest(
157 process()->id(), routing_id(), false); 157 process()->id(), routing_id(), false);
158 } 158 }
159 159
160 bool RenderViewHost::CreateRenderView(const string16& frame_name) { 160 bool RenderViewHost::CreateRenderView(const string16& frame_name) {
161 DCHECK(!IsRenderViewLive()) << "Creating view twice"; 161 DCHECK(!IsRenderViewLive()) << "Creating view twice";
162 162
163 // The process may (if we're sharing a process with another host that already 163 // The process may (if we're sharing a process with another host that already
164 // initialized it) or may not (we have our own process or the old process 164 // initialized it) or may not (we have our own process or the old process
165 // crashed) have been initialized. Calling Init multiple times will be 165 // crashed) have been initialized. Calling Init multiple times will be
166 // ignored, so this is safe. 166 // ignored, so this is safe.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 StopHangMonitorTimeout(); 361 StopHangMonitorTimeout();
362 is_waiting_for_beforeunload_ack_ = false; 362 is_waiting_for_beforeunload_ack_ = false;
363 is_waiting_for_unload_ack_ = false; 363 is_waiting_for_unload_ack_ = false;
364 364
365 sudden_termination_allowed_ = true; 365 sudden_termination_allowed_ = true;
366 delegate_->Close(this); 366 delegate_->Close(this);
367 } 367 }
368 368
369 void RenderViewHost::SetHasPendingCrossSiteRequest(bool has_pending_request, 369 void RenderViewHost::SetHasPendingCrossSiteRequest(bool has_pending_request,
370 int request_id) { 370 int request_id) {
371 Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest( 371 CrossSiteRequestManager::GetInstance()->SetHasPendingCrossSiteRequest(
372 process()->id(), routing_id(), has_pending_request); 372 process()->id(), routing_id(), has_pending_request);
373 pending_request_id_ = request_id; 373 pending_request_id_ = request_id;
374 } 374 }
375 375
376 int RenderViewHost::GetPendingRequestId() { 376 int RenderViewHost::GetPendingRequestId() {
377 return pending_request_id_; 377 return pending_request_id_;
378 } 378 }
379 379
380 void RenderViewHost::Stop() { 380 void RenderViewHost::Stop() {
381 Send(new ViewMsg_Stop(routing_id())); 381 Send(new ViewMsg_Stop(routing_id()));
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 if (printer_query.get()) { 2238 if (printer_query.get()) {
2239 BrowserThread::PostTask( 2239 BrowserThread::PostTask(
2240 BrowserThread::IO, FROM_HERE, 2240 BrowserThread::IO, FROM_HERE,
2241 NewRunnableMethod(printer_query.get(), 2241 NewRunnableMethod(printer_query.get(),
2242 &printing::PrinterQuery::StopWorker)); 2242 &printing::PrinterQuery::StopWorker));
2243 } 2243 }
2244 2244
2245 // Send the printingDone msg for now. 2245 // Send the printingDone msg for now.
2246 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); 2246 Send(new ViewMsg_PrintingDone(routing_id(), -1, true));
2247 } 2247 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_sandbox_host_linux.cc ('k') | chrome/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698