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

Side by Side Diff: chrome/browser/translate/translate_tab_helper.cc

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebased onto origin/master again, resolved conflicts Created 6 years, 7 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/translate/translate_tab_helper.h" 5 #include "chrome/browser/translate/translate_tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 0)); 294 0));
295 } 295 }
296 296
297 void TranslateTabHelper::DidNavigateAnyFrame( 297 void TranslateTabHelper::DidNavigateAnyFrame(
298 const content::LoadCommittedDetails& details, 298 const content::LoadCommittedDetails& details,
299 const content::FrameNavigateParams& params) { 299 const content::FrameNavigateParams& params) {
300 // Let the LanguageState clear its state. 300 // Let the LanguageState clear its state.
301 translate_driver_.DidNavigate(details); 301 translate_driver_.DidNavigate(details);
302 } 302 }
303 303
304 void TranslateTabHelper::WebContentsDestroyed( 304 void TranslateTabHelper::WebContentsDestroyed() {
305 content::WebContents* web_contents) {
306 // Translation process can be interrupted. 305 // Translation process can be interrupted.
307 // Destroying the TranslateManager now guarantees that it never has to deal 306 // Destroying the TranslateManager now guarantees that it never has to deal
308 // with NULL WebContents. 307 // with NULL WebContents.
309 translate_manager_.reset(); 308 translate_manager_.reset();
310 } 309 }
311 310
312 #if defined(CLD2_DYNAMIC_MODE) 311 #if defined(CLD2_DYNAMIC_MODE)
313 void TranslateTabHelper::OnCLDDataRequested() { 312 void TranslateTabHelper::OnCLDDataRequested() {
314 // Quickly try to read s_cached_file_. If valid, the file handle is 313 // Quickly try to read s_cached_file_. If valid, the file handle is
315 // cached and can be used immediately. Else, queue the caching task to the 314 // cached and can be used immediately. Else, queue the caching task to the
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 if (GetLanguageState().InTranslateNavigation()) 529 if (GetLanguageState().InTranslateNavigation())
531 return; 530 return;
532 } 531 }
533 532
534 TranslateBubbleFactory::Show( 533 TranslateBubbleFactory::Show(
535 browser->window(), web_contents(), step, error_type); 534 browser->window(), web_contents(), step, error_type);
536 #else 535 #else
537 NOTREACHED(); 536 NOTREACHED();
538 #endif 537 #endif
539 } 538 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_tab_helper.h ('k') | chrome/browser/ui/android/infobars/auto_login_prompter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698