OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // A policy for storing activity log data to a database that performs | 5 // A policy for storing activity log data to a database that performs |
6 // aggregation to reduce the size of the database. The database layout is | 6 // aggregation to reduce the size of the database. The database layout is |
7 // nearly the same as FullStreamUIPolicy, which stores a complete log, with a | 7 // nearly the same as FullStreamUIPolicy, which stores a complete log, with a |
8 // few changes: | 8 // few changes: |
9 // - a "count" column is added to track how many log records were merged | 9 // - a "count" column is added to track how many log records were merged |
10 // together into this row | 10 // together into this row |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 {Action::ACTION_API_CALL, "cookies.getAll"}, | 70 {Action::ACTION_API_CALL, "cookies.getAll"}, |
71 {Action::ACTION_API_CALL, "extension.connect"}, | 71 {Action::ACTION_API_CALL, "extension.connect"}, |
72 {Action::ACTION_API_CALL, "extension.sendMessage"}, | 72 {Action::ACTION_API_CALL, "extension.sendMessage"}, |
73 {Action::ACTION_API_CALL, "fileSystem.chooseEntry"}, | 73 {Action::ACTION_API_CALL, "fileSystem.chooseEntry"}, |
74 {Action::ACTION_API_CALL, "socket.bind"}, | 74 {Action::ACTION_API_CALL, "socket.bind"}, |
75 {Action::ACTION_API_CALL, "socket.connect"}, | 75 {Action::ACTION_API_CALL, "socket.connect"}, |
76 {Action::ACTION_API_CALL, "socket.create"}, | 76 {Action::ACTION_API_CALL, "socket.create"}, |
77 {Action::ACTION_API_CALL, "socket.listen"}, | 77 {Action::ACTION_API_CALL, "socket.listen"}, |
78 {Action::ACTION_API_CALL, "tabs.executeScript"}, | 78 {Action::ACTION_API_CALL, "tabs.executeScript"}, |
79 {Action::ACTION_API_CALL, "tabs.insertCSS"}, | 79 {Action::ACTION_API_CALL, "tabs.insertCSS"}, |
| 80 {Action::ACTION_API_CALL, "types.ChromeSetting.clear"}, |
| 81 {Action::ACTION_API_CALL, "types.ChromeSetting.get"}, |
| 82 {Action::ACTION_API_CALL, "types.ChromeSetting.set"}, |
80 {Action::ACTION_CONTENT_SCRIPT, ""}, | 83 {Action::ACTION_CONTENT_SCRIPT, ""}, |
81 {Action::ACTION_DOM_ACCESS, "Document.createElement"}, | 84 {Action::ACTION_DOM_ACCESS, "Document.createElement"}, |
82 {Action::ACTION_DOM_ACCESS, "Document.createElementNS"}, | 85 {Action::ACTION_DOM_ACCESS, "Document.createElementNS"}, |
83 }; | 86 }; |
84 | 87 |
85 // Columns in the main database table. See the file-level comment for a | 88 // Columns in the main database table. See the file-level comment for a |
86 // discussion of how data is stored and the meanings of the _x columns. | 89 // discussion of how data is stored and the meanings of the _x columns. |
87 const char* kTableContentFields[] = { | 90 const char* kTableContentFields[] = { |
88 "count", "extension_id_x", "time", "action_type", "api_name_x", "args_x", | 91 "count", "extension_id_x", "time", "action_type", "api_name_x", "args_x", |
89 "page_url_x", "page_title_x", "arg_url_x", "other_x"}; | 92 "page_url_x", "page_title_x", "arg_url_x", "other_x"}; |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 return true; | 792 return true; |
790 } | 793 } |
791 | 794 |
792 void CountingPolicy::Close() { | 795 void CountingPolicy::Close() { |
793 // The policy object should have never been created if there's no DB thread. | 796 // The policy object should have never been created if there's no DB thread. |
794 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::DB)); | 797 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::DB)); |
795 ScheduleAndForget(activity_database(), &ActivityDatabase::Close); | 798 ScheduleAndForget(activity_database(), &ActivityDatabase::Close); |
796 } | 799 } |
797 | 800 |
798 } // namespace extensions | 801 } // namespace extensions |
OLD | NEW |