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

Side by Side Diff: chrome/renderer/translate/translate_helper.cc

Issue 569233002: Refactoring the order of the weak_ptr_factory in chrome/renderer folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « chrome/renderer/translate/translate_helper.h ('k') | 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/renderer/translate/translate_helper.h" 5 #include "chrome/renderer/translate/translate_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } // namespace 74 } // namespace
75 75
76 76
77 //////////////////////////////////////////////////////////////////////////////// 77 ////////////////////////////////////////////////////////////////////////////////
78 // TranslateHelper, public: 78 // TranslateHelper, public:
79 // 79 //
80 TranslateHelper::TranslateHelper(content::RenderView* render_view) 80 TranslateHelper::TranslateHelper(content::RenderView* render_view)
81 : content::RenderViewObserver(render_view), 81 : content::RenderViewObserver(render_view),
82 page_seq_no_(0), 82 page_seq_no_(0),
83 translation_pending_(false), 83 translation_pending_(false),
84 weak_method_factory_(this),
85 cld_data_provider_(translate::CreateRendererCldDataProviderFor(this)), 84 cld_data_provider_(translate::CreateRendererCldDataProviderFor(this)),
86 cld_data_polling_started_(false), 85 cld_data_polling_started_(false),
87 cld_data_polling_canceled_(false), 86 cld_data_polling_canceled_(false),
88 deferred_page_capture_(false), 87 deferred_page_capture_(false),
89 deferred_page_seq_no_(-1) { 88 deferred_page_seq_no_(-1),
89 weak_method_factory_(this) {
90 } 90 }
91 91
92 TranslateHelper::~TranslateHelper() { 92 TranslateHelper::~TranslateHelper() {
93 CancelPendingTranslation(); 93 CancelPendingTranslation();
94 CancelCldDataPolling(); 94 CancelCldDataPolling();
95 } 95 }
96 96
97 void TranslateHelper::PrepareForUrl(const GURL& url) { 97 void TranslateHelper::PrepareForUrl(const GURL& url) {
98 ++page_seq_no_; 98 ++page_seq_no_;
99 Send(new ChromeViewHostMsg_TranslateAssignedSequenceNumber( 99 Send(new ChromeViewHostMsg_TranslateAssignedSequenceNumber(
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 // be DEFERRED until CLD is ready. In the latter case, CLD is in dynamic mode 646 // be DEFERRED until CLD is ready. In the latter case, CLD is in dynamic mode
647 // and may eventually become available, triggering the RESUMED event; after 647 // and may eventually become available, triggering the RESUMED event; after
648 // this, everything should start being ON_TIME. This should never run more 648 // this, everything should start being ON_TIME. This should never run more
649 // than twice in a page load, under any conditions. 649 // than twice in a page load, under any conditions.
650 // Also note that language detection is triggered off of a delay AFTER the 650 // Also note that language detection is triggered off of a delay AFTER the
651 // page load completed event has fired, making this very much off the critical 651 // page load completed event has fired, making this very much off the critical
652 // path. 652 // path.
653 content::RenderThread::Get()->UpdateHistograms( 653 content::RenderThread::Get()->UpdateHistograms(
654 content::kHistogramSynchronizerReservedSequenceNumber); 654 content::kHistogramSynchronizerReservedSequenceNumber);
655 } 655 }
OLDNEW
« no previous file with comments | « chrome/renderer/translate/translate_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698