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

Side by Side Diff: chrome/browser/extensions/api/page_capture/page_capture_api.cc

Issue 1780813002: [Merge to 2661] Remove extra Release in pageCapture extension function implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 "chrome/browser/extensions/api/page_capture/page_capture_api.h" 5 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ReturnSuccess(mhtml_file_size); 150 ReturnSuccess(mhtml_file_size);
151 } 151 }
152 152
153 void PageCaptureSaveAsMHTMLFunction::ReturnFailure(const std::string& error) { 153 void PageCaptureSaveAsMHTMLFunction::ReturnFailure(const std::string& error) {
154 DCHECK_CURRENTLY_ON(BrowserThread::UI); 154 DCHECK_CURRENTLY_ON(BrowserThread::UI);
155 155
156 error_ = error; 156 error_ = error;
157 157
158 SendResponse(false); 158 SendResponse(false);
159 159
160 Release(); // Balanced in Run() 160 // Must not Release() here, OnMessageReceived will call it eventually.
161 } 161 }
162 162
163 void PageCaptureSaveAsMHTMLFunction::ReturnSuccess(int64_t file_size) { 163 void PageCaptureSaveAsMHTMLFunction::ReturnSuccess(int64_t file_size) {
164 DCHECK_CURRENTLY_ON(BrowserThread::UI); 164 DCHECK_CURRENTLY_ON(BrowserThread::UI);
165 165
166 WebContents* web_contents = GetWebContents(); 166 WebContents* web_contents = GetWebContents();
167 if (!web_contents || !render_frame_host()) { 167 if (!web_contents || !render_frame_host()) {
168 ReturnFailure(kTabClosedError); 168 ReturnFailure(kTabClosedError);
169 return; 169 return;
170 } 170 }
(...skipping 22 matching lines...) Expand all
193 GetProfile(), 193 GetProfile(),
194 include_incognito(), 194 include_incognito(),
195 &browser, 195 &browser,
196 NULL, 196 NULL,
197 &web_contents, 197 &web_contents,
198 NULL)) { 198 NULL)) {
199 return NULL; 199 return NULL;
200 } 200 }
201 return web_contents; 201 return web_contents;
202 } 202 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698