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

Side by Side Diff: chrome/renderer/autofill/form_cache.h

Issue 7983028: Don't cache WebFrame pointers for Autofill, as these can become stale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/autofill/form_cache.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ 5 #ifndef CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_
6 #define CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ 6 #define CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/string16.h" 13 #include "base/string16.h"
14 14
15 namespace webkit_glue { 15 namespace webkit_glue {
16 struct FormData; 16 struct FormData;
17 struct FormDataPredictions; 17 struct FormDataPredictions;
18 } // namespace webkit_glue 18 } // namespace webkit_glue
19 19
20 namespace WebKit { 20 namespace WebKit {
21 class WebDocument;
21 class WebFormControlElement; 22 class WebFormControlElement;
22 class WebFrame; 23 class WebFrame;
23 class WebInputElement; 24 class WebInputElement;
24 class WebSelectElement; 25 class WebSelectElement;
25 } // namespace WebKit 26 } // namespace WebKit
26 27
27 namespace autofill { 28 namespace autofill {
28 29
29 // Manages the forms in a RenderView. 30 // Manages the forms in a RenderView.
30 class FormCache { 31 class FormCache {
(...skipping 14 matching lines...) Expand all
45 bool ClearFormWithElement(const WebKit::WebInputElement& element); 46 bool ClearFormWithElement(const WebKit::WebInputElement& element);
46 47
47 // For each field in the |form|, sets the field's placeholder text to the 48 // For each field in the |form|, sets the field's placeholder text to the
48 // field's overall predicted type. Also sets the title to include the field's 49 // field's overall predicted type. Also sets the title to include the field's
49 // heuristic type, server type, and signature; as well as the form's signature 50 // heuristic type, server type, and signature; as well as the form's signature
50 // and the experiment id for the server predictions. 51 // and the experiment id for the server predictions.
51 bool ShowPredictions(const webkit_glue::FormDataPredictions& form); 52 bool ShowPredictions(const webkit_glue::FormDataPredictions& form);
52 53
53 private: 54 private:
54 // The cached web frames. 55 // The cached web frames.
55 std::set<const WebKit::WebFrame*> web_frames_; 56 std::set<WebKit::WebDocument> web_documents_;
56 57
57 // The cached initial values for <select> elements. 58 // The cached initial values for <select> elements.
58 std::map<const WebKit::WebSelectElement, string16> initial_select_values_; 59 std::map<const WebKit::WebSelectElement, string16> initial_select_values_;
59 60
60 DISALLOW_COPY_AND_ASSIGN(FormCache); 61 DISALLOW_COPY_AND_ASSIGN(FormCache);
61 }; 62 };
62 63
63 } // namespace autofill 64 } // namespace autofill
64 65
65 #endif // CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_ 66 #endif // CHROME_RENDERER_AUTOFILL_FORM_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/autofill/form_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698