Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: installer/src/installer-lib/process.h

Issue 6003395731128320: Only take into account processes that have our plugin loaded (Closed)
Left Patch Set: Do not fake C++ iterators Created March 28, 2014, 2:26 p.m.
Right Patch Set: Simplify Process_Closer constructor Created March 31, 2014, 8:31 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « installer/src/custom-action/close_application.cpp ('k') | installer/src/installer-lib/process.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /** 1 /**
2 * \file process.h 2 * \file process.h
3 */ 3 */
4 4
5 #ifndef PROCESS_H 5 #ifndef PROCESS_H
6 #define PROCESS_H 6 #define PROCESS_H
7 7
8 #include <vector> 8 #include <vector>
9 #include <set> 9 #include <set>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 { 100 {
101 bool operator()( const file_name & a, const file_name & b ) const 101 bool operator()( const file_name & a, const file_name & b ) const
102 { 102 {
103 return wcscmpi( a.name, b.name ) < 0 ; 103 return wcscmpi( a.name, b.name ) < 0 ;
104 } 104 }
105 } ; 105 } ;
106 106
107 struct file_name_set 107 struct file_name_set
108 : public std::set< file_name > 108 : public std::set< file_name >
109 { 109 {
110 file_name_set(){};
111
110 file_name_set( const wchar_t * file_name_list[], size_t n_file_names ) 112 file_name_set( const wchar_t * file_name_list[], size_t n_file_names )
111 { 113 {
112 for ( unsigned int j = 0 ; j < n_file_names ; ++ j ) 114 for ( unsigned int j = 0 ; j < n_file_names ; ++ j )
113 { 115 {
114 insert( file_name( file_name_list[ j ] ) ) ; 116 insert( file_name( file_name_list[ j ] ) ) ;
115 } 117 }
116 } 118 }
117 } ; 119 } ;
118 120
119 //------------------------------------------------------- 121 //-------------------------------------------------------
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if ( ! b ) 557 if ( ! b )
556 { 558 {
557 // Assert the process that created the window is not in our pid_set 559 // Assert the process that created the window is not in our pid_set
558 return true ; 560 return true ;
559 } 561 }
560 return f( window ) ; 562 return f( window ) ;
561 } 563 }
562 } ; 564 } ;
563 565
564 public: 566 public:
565 Process_Closer( Snapshot & snapshot, const wchar_t * file_name_list[], size_t n_file_names, const wchar_t * module_name_list[], size_t n_module_names ) 567 template <size_t n_file_names, size_t n_module_names>
566 : snapshot( snapshot ), file_names( file_name_list, n_file_names ), module_n ames(module_name_list, n_module_names), filter( file_names, module_names ) 568 Process_Closer(Snapshot & snapshot, const wchar_t* (&file_name_list)[n_file_na mes], const wchar_t* (&module_name_list)[n_module_names])
569 : snapshot(snapshot), file_names(file_name_list, n_file_names), module_names (module_name_list, n_module_names), filter(file_names, module_names)
570 {
571 update() ;
572 }
573 template <size_t n_file_names>
574 Process_Closer(Snapshot & snapshot, const wchar_t * (&file_name_list)[n_file_n ames])
575 : snapshot(snapshot), file_names(file_name_list, n_file_names), module_names (), filter(file_names, module_names)
567 { 576 {
568 update() ; 577 update() ;
569 } 578 }
570 579
571 /** 580 /**
572 * Refresh our state to match the snapshot state. 581 * Refresh our state to match the snapshot state.
573 */ 582 */
574 void refresh() 583 void refresh()
575 { 584 {
576 pid_set.clear() ; 585 pid_set.clear() ;
(...skipping 12 matching lines...) Expand all
589 } 598 }
590 599
591 /* 600 /*
592 * Shut down every process in the pid_set. 601 * Shut down every process in the pid_set.
593 */ 602 */
594 bool shut_down() ; 603 bool shut_down() ;
595 604
596 } ; 605 } ;
597 606
598 #endif 607 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld